package com.ruoyi.order.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.order.api.domain.ErpSellerOrder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(contextId = "remoteErpOrderService", value = ServiceNameConstants.ORDER_SERVICE)
public interface RemoteErpOrderService {

    /**
     * 修改订单状态
     */
    @GetMapping("/order/sellerOrder/setInnerStatus")
    Integer setInnerStatus(@RequestParam("orderId") Long orderId, @RequestParam("status") String status, @RequestParam("flag") String flag);

    /**
     * 从AE拉取订单
     * @return
     */
    @GetMapping("/order/ae/pullOrdersFromAliExpress/{sellerId}/{createDateStart}/{createDateEnd}")
    R<Object> pullOrdersFromAliExpress(@PathVariable("sellerId") String sellerId,
                                       @PathVariable("createDateStart") String createDateStart,
                                       @PathVariable("createDateEnd") String createDateEnd);

    /**
     * 根据订单号，获取订单延伸表信息
     * @param orderId
     * @return
     */
    @GetMapping("/order/sellerOrderExtend/getByOrderId/{orderId}")
    R<Object> getByOrderId(@PathVariable("orderId") String orderId);
    

    /**
     * 根据店铺cn码，获取最新一条的订单信息
     * @param storeUserName
     * @return
     */
    @GetMapping("/order/sellerOrder/getNewestOrderByStoreUserName/{storeUserName}")
    R<Object> getNewestOrderByStoreUserName(@PathVariable("storeUserName") String storeUserName);

    /**
     * 根据订单号获取订单信息
     */
    @GetMapping("/order/sellerOrder/getInfoByOrderId/{orderId}")
    ErpSellerOrder getInfoByOrderId(@PathVariable("orderId") Long orderId);

    
}
